{
if (GTK_IS_WINDOW (widget))
{
+ GtkWidget *focus_widget;
GtkWindow *window;
+ GtkWindowType type;
window = GTK_WINDOW (widget);
- if (window->focus_widget)
+ focus_widget = gtk_window_get_focus (window);
+ g_object_get (window, "type", &type, NULL);
+
+ if (focus_widget)
{
/*
* If we already have a potential focus widget set this
!focus_before_menu)
{
void *vp_focus_before_menu = &focus_before_menu;
- focus_before_menu = window->focus_widget;
+ focus_before_menu = focus_widget;
g_object_add_weak_pointer (G_OBJECT (focus_before_menu), vp_focus_before_menu);
}
return TRUE;
}
- widget = window->focus_widget;
+ widget = focus_widget;
}
- else if (window->type == GTK_WINDOW_POPUP)
+ else if (type == GTK_WINDOW_POPUP)
{
if (GTK_IS_BIN (widget))
{
* Deactivate window if it is still focused and we are removing it. This
* can happen when a dialog displayed by gok is removed.
*/
- if (window->is_active &&
- window->has_toplevel_focus)
+ if (gtk_window_is_active (window) &&
+ gtk_window_has_toplevel_focus (window))
{
gchar *signal_name;
AtkObject *atk_obj;
event = g_value_get_boxed (param_values + 1);
if (event->type != GDK_CONFIGURE)
return FALSE;
- if (GTK_WINDOW (object)->configure_request_count)
- /*
- * There is another ConfigureRequest pending so we ignore this one.
- */
- return TRUE;
widget = GTK_WIDGET (object);
gtk_widget_get_allocation (widget, &allocation);
if (allocation.x == ((GdkEventConfigure *)event)->x &&
obj->role = ATK_ROLE_TOOL_TIP;
else if (GTK_IS_PLUG (widget))
obj->role = ATK_ROLE_PANEL;
- else if (GTK_WINDOW (widget)->type == GTK_WINDOW_POPUP)
+ else if (gtk_window_get_window_type (GTK_WINDOW (widget)) == GTK_WINDOW_POPUP)
obj->role = ATK_ROLE_WINDOW;
else
obj->role = ATK_ROLE_FRAME;
window = GTK_WINDOW (widget);
- if (window->has_focus)
+ if (gtk_window_has_toplevel_focus (window) && gtk_window_is_active (window))
atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
gdk_window = gtk_widget_get_window (widget);
widget = GTK_WIDGET (object);
if (GTK_IS_WINDOW (widget))
{
- GtkWidget *focus_widget = GTK_WINDOW (widget)->focus_widget;
+ GtkWidget *focus_widget = gtk_window_get_focus (GTK_WINDOW (widget));
if (focus_widget != NULL)
widget = focus_widget;
}
title = NULL;
toplevel = gtk_widget_get_toplevel (widget);
- if (GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->title)
- {
- title = GTK_WINDOW (toplevel)->title;
- }
+ if (GTK_IS_WINDOW (toplevel))
+ title = (gchar *) gtk_window_get_title (GTK_WINDOW (toplevel));
else
title = NULL;
}